﻿@model Cafe.Models.IndexVM

<div class="jumbotron">
    <h1>Cafe Reviews</h1>
</div>

<div>
    <table class="table table-hover">
        <thead>
            <tr><th>Name</th><th>Category</th><th>Location</th></tr>
        </thead>
        <tbody>
            @foreach (var cafe in Model.cafes)
            {
                <tr onclick="location.href='/Home/Detail/@cafe.ID'">
                   <td>@cafe.Name</td>
                    <td>@cafe.Category</td>
                    <td>@cafe.Location</td>
                    <td>
                        <form method="post" action="/Home/DeleteCafe" >
                            <input hidden type="text" value="@cafe.ID" name="id" />
                            <input type="submit" value="Delete" />  
                        </form>
                        <form method="get" action="/Home/EditCafe">
                            <input hidden type="text" value="@cafe.ID" name="id" />
                            <input type="submit" value="Edit" />
                        </form>
                        <a href="/Home/Index/@Model.PrevIndex">Prev</a>
                        <a href="/Home/Index/@Model.NextIndex">Next</a>
                    </td>
                </tr>
            }

        </tbody>

    </table>

</div>